Graphical models may be used to simulate types of physical systems, such as discrete systems, event-based systems, time-based systems, state-based systems, data flow-based systems, etc. These models may consist of components, such as blocks, that reference executable code for performing operations when the graphical model is executing. The blocks can vary in type and/or number and may be connected together to build large, complex models (e.g., models including hundreds or possibly thousands of interconnected blocks).
A user of a model may wish to perform certain operations in the model. For example, a user may wish to reset states for blocks having storage to an initial value. By way of example, a model may include a counter block that increments a counter every time the counter block receives an input signal value. The user may wish to reset a state for the counter block to an initial value, e.g., zero, at some point during model execution.
Current modeling applications may require that the user supply an explicit reset line from a reset block that provides a reset signal to each block that includes state, e.g., the counter block in the example. Current modeling applications may further require that the user configure the reset block via a dialog box before the state of a counter block can be reset. The user may then need to manually apply the reset signal to the explicit reset line to reset the state of a counter block.
When a model includes several blocks having state, the user may have to draw multiple reset blocks and/or many explicit reset lines so that states of the resettable blocks can be reset. These reset blocks and explicit reset lines may clutter the model thus making it difficult for a user to diagnose and/or understand the model. The use of explicit reset lines may become even more cumbersome when a model includes resettable blocks that reside in subsystems, where a subsystem represents a group of blocks sharing a relationship with each other. Resetting blocks within the subsystem may require that the user draw individual explicit reset lines from reset blocks outside the subsystem into the subsystem and then to each subsystem block that includes a state that needs resetting. This approach can clutter the subsystem and/or the model and may be prone to user error, e.g., when the user forgets to account for a resettable block in the subsystem.